#include<bits/stdc++.h>
#define y1 Y1
#define fi first
#define endl "\n"
#define se second
#define PI acos(-1)
#define int long long
#define pb(x) push_back(x)
#define PII pair<int, int>
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define _for(i, a, b) for(int i = a; i <= b; ++i)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;

const int N = 2e5 + 10;
const int mod = 1e9 + 7;

int a[N], b[N];
int n, m, t, ret, x;
string s;

signed main() {
	IOS;
	cin >> n >> m >> x;
	_for(i, 1, n) {
		cin >> a[i];
	}
	
	_for(i, 1, m) {
		cin >> b[i];
	}
	sort(a + 1, a + n + 1);
	sort(b + 1, b + m + 1);
	_for(i, 1, n) {
		cout << a[i] << ' ';
	}
	cout << endl;
	_for(j, 1, m) {
		cout << b[j] << ' ';
	}
	cout << endl;
	
	for(int i = m, j = n; i >= 1; -- i ) {
		if(x - b[i] <= 0) {
			x = 0;
			ret ++ ;
			break;
		}
		if(i >= 2) {
			if(b[i] + b[i - 1] > a[j] * b[i]) {
				//cout << "i = " << i << endl;
				ret += 2;
				x -= (b[i] + b[i + 1]);	
				i -- ;
				if(x <= 0)break;
			} else {
				ret += 2;
				x -= (a[j] * b[i]);
				j -- ;
				if(x <= 0)break;
			}
		} else {
			if(b[i] >= x) {
				x -= b[i];
				ret ++ ;
			} else if(b[i] * a[j] >= x) {
				x -= (b[i] * a[j]);
				ret += 2;
			}
		}
		//cout << "i = " << i << " x = " << x << " ret = " << ret << endl;
	}
	ret = x > 0 ? -1 : ret;
	cout << ret << endl;
	return 0;
}


